﻿#ifndef SOCKETTHREAD_H
#define SOCKETTHREAD_H

#include <QObject>
#include <QThread>
#include<QTcpSocket>
#include "CommonType.h"
#pragma execution_character_set("utf-8")

class SocketThread : public QThread
{
    Q_OBJECT
public:
    SocketThread(QTcpSocket * socket);

private:
    QTcpSocket * socket;
    char buffer[10240];
    int bufIdx;
    bool bRun;

    void process();
protected:
    virtual void run();

private slots:
    void socketDisconnected();
};

#endif // SOCKETTHREAD_H
